package Three_ZhuChangShuang.menu;

import Three_ZhuChangShuang.service.UserServices;

import java.util.Scanner;

/**
 * @Author zhu
 * @Date 2021/3/24 16:13
 * @ClassNmae UserMenu
 * @Description 用户登录过后的菜单
 */
public class UserMenu {
    UserServices userServices;

    public UserServices getUserServices() {
        return userServices;
    }

    public void setUserServices(UserServices userServices) {
        this.userServices = userServices;
    }

    public void userView() {
        Scanner scanner = new Scanner(System.in);
        boolean isExit = false;
        while (!isExit) {
            System.out.println("=================================================================================");
            System.out.println("请选择：\t 1.灭活疫苗预约 \t 2.腺病毒载体疫苗预约 \t 3.修改联系方式 \t 4.修改密码 \t 0.退出登录");
            System.out.println("=================================================================================");
            try {
                int choose = Integer.parseInt(scanner.next());
                switch (choose) {
                    case 1: {
                        userServices.iVaccineApp();
                        break;
                    }
                    case 2: {
                        userServices.aVaccineApp();
                        break;
                    }
                    case 3: {
                        userServices.modifyNumber();
                        break;
                    }
                    case 4: {
                        userServices.modifyPassword();
                        break;
                    }
                    case 0: {
                        System.out.println("退出登录");
                        return;
                    }
                    default: {
                        System.out.println("请输入正确的选项！");
                    }
                }
            } catch (Exception e) {
                //e.printStackTrace();
                System.out.println("请输入正确的选项！");

            }
        }
    }
}
